const columns = [
    {
        prop: 'username',
        label: '登录名'
    },
    {
        prop: 'name',
        label: '姓名'
    },
    {
        prop: 'organizationTitle',
        label: '所属部门',
        width: 200
    },
    {
        prop: 'telephone',
        label: '联系电话',
        width: 150
    },
    {
        prop: 'email',
        label: '邮件',
        width: 150
    },
    {
        prop: 'enabled',
        label: '启用'
    },
    {
        label: '操作',
        width: 250,
        operations: [
            {
                prop: 'edit',
                auId: 110204,
                label: '编辑'
            },
            {
                prop: 'delete',
                auId: 110205,
                label: '删除'
            },
            {
                prop: 'resetpassword',
                label: '重置密码'
            }
        ]
    }
]

const enableOptions = [
    {
        id: true,
        title: '是'
    },
    {
        id: false,
        title: '否'
    }
]

const options = [
    {
        value: 'batchrefresh',
        label: '刷新'
    },
    {
        value: 'batchdelete',
        label: '批量删除'
    }
]

const addFormItems = [
    {
        label: '所属机构',
        prop: 'organizationIds',
        name: 'cascader',
        props: {
            value: 'id',
            label: 'title',
            children: 'children'
        },
        validation: true
    },
    {
        label: '启用',
        prop: 'enabled',
        name: 'checkbox'
    },
    {
        label: '登录名',
        prop: 'username',
        name: 'input',
        validation: true
    },
    {
        label: '姓名',
        prop: 'name',
        name: 'input',
        validation: true
    },
    {
        label: '密码',
        prop: 'password',
        name: 'input',
        validation: true
    },
    {
        label: '确认密码',
        prop: 'confirmPassword',
        name: 'input',
        validation: true
    },
    {
        label: '电话',
        prop: 'telephone',
        name: 'input'
    },
    {
        label: '邮件',
        prop: 'email',
        name: 'input'
    },
    {
        label: '用户角色',
        prop: 'roleIds',
        multiple: true,
        name: 'search',
        validation: true
    },
    {
        label: '管辖部门',
        prop: 'mngedOrgIds',
        name: 'tree',
        props: {
            value: 'id',
            label: 'title',
            children: 'children'
        },
        validation: true
    }
]

const editFormItems = [
    {
        label: '所属机构',
        prop: 'organizationIds',
        name: 'cascader',
        props: {
            value: 'id',
            label: 'title',
            children: 'children'
        }
    },
    {
        label: '用户编号',
        prop: 'employeeNumber',
        name: 'input'
    },
    {
        label: '启用',
        prop: 'enabled',
        name: 'checkbox'
    },
    {
        label: '登录名',
        prop: 'username',
        name: 'input'
    },
    {
        label: '姓名',
        prop: 'name',
        name: 'input'
    },
    {
        label: '电话',
        prop: 'telephone',
        name: 'input'
    },
    {
        label: '邮件',
        prop: 'email',
        name: 'input'
    },
    {
        label: '用户角色',
        prop: 'roleIds',
        multiple: true,
        name: 'search'
    },
    {
        label: '管辖部门',
        prop: 'mngedOrgIds',
        name: 'tree',
        props: {
            value: 'id',
            label: 'title',
            children: 'children',
            disabled: data => !data.writable
        }
    }
]

const passwordFormItems = [
    {
        label: '用户名',
        prop: 'name',
        disabled: true,
        name: 'input'
    },
    {
        label: '姓名',
        prop: 'username',
        disabled: true,
        name: 'input'
    },
    {
        label: '重置密码',
        prop: 'password',
        name: 'input'
    }
]

export default {
    columns,
    enableOptions,
    options,
    addFormItems,
    editFormItems,
    passwordFormItems
}
